﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;

namespace Wy.JiZhangSoft.Notes
{
    public class Note : FullAuditedAggregateRoot<Guid>
    {
        private string content;

        public Note(Guid id) : base(id)
        {
        }

        public Note() { }

        public string Content
        {
            get => content;
            set
            {
                content = value;
                ComputeShow();
            }
        }


        public string Show { get; private set; }

        public EnumNoteType NoteType { get; set; }

        private void ComputeShow()
        {
            if (Content.Length <= 17)
                Show = Content;
            else
                Show = Content.Substring(0, 18)+"...";
        }
    }
}
